[XEN] Shadow: ignore shadow operations on dying domains
authorTim Deegan <Tim.Deegan@xensource.com>
Tue, 6 Mar 2007 15:02:20 +0000 (15:02 +0000)
committerTim Deegan <Tim.Deegan@xensource.com>
Tue, 6 Mar 2007 15:02:20 +0000 (15:02 +0000)
so that they don't get confused by the way that shadow_teardown()
leaves some of the mode bits set after releasing the shadow resources.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen/arch/x86/mm/shadow/common.c

index 5b96bd986ac3fb57fe0e0fdf889d3880f40d6f2c..f341fe3bc871de6a390e4309b2169c381255bde1 100644 (file)
@@ -2977,10 +2977,18 @@ int shadow_domctl(struct domain *d,
 
     if ( unlikely(d == current->domain) )
     {
-        gdprintk(XENLOG_INFO, "Don't try to do a shadow op on yourself!\n");
+        gdprintk(XENLOG_INFO, "Dom %u tried to do a shadow op on itself.\n",
+                 d->domain_id);
         return -EINVAL;
     }
 
+    if ( unlikely(test_bit(_DOMF_dying, &d->domain_flags)) )
+    {
+        gdprintk(XENLOG_INFO, "Ignoring shadow op on dying domain %u\n",
+                 d->domain_id);
+        return 0;
+    }
+
     switch ( sc->op )
     {
     case XEN_DOMCTL_SHADOW_OP_OFF: